package com.backend.modules.task.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@Schema(description = "任务提交参数")
public class TaskSubmissionDTO {
    
    @Schema(description = "任务ID", required = true)
    @NotNull(message = "任务ID不能为空")
    private Long taskId;
    
    @Schema(description = "文件列表", required = true)
    @NotEmpty(message = "文件不能为空")
    @Valid
    private List<SubmissionFileDTO> files;
    
    @Schema(description = "提交说明")
    private String comment;
    @Data
    @Schema(description = "提交文件参数")
    public static class SubmissionFileDTO {

        @Schema(description = "文件名", required = true)
        @NotEmpty(message = "文件名不能为空")
        private String fileName;

        @Schema(description = "文件URL", required = true)
        @NotEmpty(message = "文件URL不能为空")
        private String fileUrl;

        @Schema(description = "文件大小", required = true)
        @NotNull(message = "文件大小不能为空")
        private Long fileSize;

        @Schema(description = "文件类型", required = true)
        @NotEmpty(message = "文件类型不能为空")
        private String fileType;

        @Schema(description = "排序号")
        private Integer sort = 0;
    }
}

